import request, { download } from "@/utils/request";
import { isExcelFile, exportExcel } from "@/common/index";
// /admin/community/member/page
// 查询住户列表
export function getCommunityMemberPage(query) {
  return request({
    url: "/admin/community/member/building/record/page",
    method: "get",
    params: query,
  });
}
// /admin/community/member/audit
// 审核住户
export function auditCommunityMember(data) {
  return request({
    url: "/admin/community/member/building/record/update",
    method: "post",
    data: data,
  });
}
// /admin/community/member/updateState
// 更新住户状态
export function updateCommunityMemberState(data) {
  return request({
    url: "/admin/community/member/updateState",
    method: "post",
    data: data,
  });
}
// /admin/community/member/remove
// 删除住户
export function removeCommunityMember(data) {
  return request({
    url: "/admin/community/member/remove",
    method: "post",
    data: data,
  });
}

// /admin/community/region/page
// 查询区域列表
export function getRegionPage(query) {
  return request({
    url: "/admin/community/region/page",
    method: "get",
    params: query,
  });
}
// /admin/community/region/save
// 保存区域
export function saveRegion(data) {
  return request({
    url: "/admin/community/region/save",
    method: "post",
    data: data,
  });
}
// /admin/community/region/update
// 更新区域
export function updateRegion(data) {
  return request({
    url: "/admin/community/region/update",
    method: "post",
    data: data,
  });
}
// /admin/community/region/remove
// 删除区域
export function removeRegion(id) {
  return request({
    url: `/admin/community/region/remove`,
    method: "post",
    params: { id },
  });
}

// /admin/community/save
// 保存小区
export function saveCommunity(data) {
  return request({
    url: "/admin/community/save",
    method: "post",
    data: data,
  });
}
// /admin/community/update
// 更新小区
export function updateCommunity(data) {
  return request({
    url: "/admin/community/update",
    method: "post",
    data: data,
  });
}

// /admin/community/page
// 查询小区列表
export function getCommunityPage(query) {
  return request({
    url: "/admin/community/page",
    method: "get",
    params: query,
  });
}
// // /admin/community/remove
// // 删除小区
// export function deleteCommunity(data) {
//   return request({
//     url: "/admin/community/remove",
//     method: "post",
//     data: data,
//   });
// }

// /admin/floor/page
// 查询楼栋列表
export function getFloorPage(query) {
  return request({
    url: "/admin/floor/page",
    method: "get",
    params: query,
  });
}

// /admin/floor/save
// 保存楼栋
export function saveFloor(data) {
  return request({
    url: "/admin/floor/save",
    method: "post",
    data: data,
  });
}
// /admin/floor/remove
// 删除楼栋
export function removeFloor(data) {
  return request({
    url: "/admin/floor/remove",
    method: "post",
    query: data,
  });
}
// /admin/floor/update
// 更新楼栋
export function updateFloor(data) {
  return request({
    url: "/admin/floor/update",
    method: "post",
    data: data,
  });
}

// /admin/building/room/page
// 查询房屋列表
export function getBuildingRoomPage(query) {
  return request({
    url: "/admin/building/room/page",
    method: "get",
    params: query,
  });
}
// /admin/building/room/save
// 保存房屋
export function saveBuildingRoom(data) {
  return request({
    url: "/admin/building/room/save",
    method: "post",
    data: data,
  });
}
// /admin/building/room/update
// 更新房屋
export function updateBuildingRoom(data) {
  return request({
    url: "/admin/building/room/update",
    method: "post",
    data: data,
  });
}
// /admin/building/room/remove
// 删除房屋
export function removeBuildingRoom(data) {
  return request({
    url: "/admin/building/room/remove",
    method: "post",
    data: data,
  });
}
// /admin/building/room/selectChargingItem
// 查询房屋收费项目
export function selectChargingItem(query) {
  return request({
    url: "/admin/building/room/selectChargingItem",
    method: "get",
    params: query,
  });
}
// /admin/community/fee/config/page
// 查询收费标准列表
export function getChargingStandardPage(query) {
  return request({
    url: "/admin/community/fee/config/page",
    method: "get",
    params: query,
  });
}

// /admin/community/fee/config/selectNamePage
// 查询收费标准名称列表
export function selectChargingStandardNamePage(query) {
  return request({
    url: "/admin/community/fee/config/selectNamePage",
    method: "get",
    params: query,
  });
}
// /admin/community/fee/config/detail
// 查询收费标准详情
export function getChargingStandardDetail(id) {
  return request({
    url: `/admin/community/fee/config/detail/${id}`,
    method: "get",
  });
}
// /admin/community/fee/config/save
// 保存收费标准
export function saveChargingStandard(data) {
  return request({
    url: "/admin/community/fee/config/save",
    method: "post",
    data: data,
  });
}
// /admin/community/fee/config/update
// 更新收费标准
export function updateChargingStandard(data) {
  return request({
    url: "/admin/community/fee/config/update",
    method: "post",
    data: data,
  });
}
// /admin/community/fee/config/remove
// 删除收费标准
export function removeChargingStandard(data) {
  return request({
    url: "/admin/community/fee/config/remove",
    method: "post",
    query: data,
  });
}
// /admin/building/room/batchUpdateFeeConfigToBuildingRoom
// 批量更新房屋收费标准
export function batchUpdateFeeConfigToBuildingRoom(data) {
  return request({
    url: "/admin/building/room/batchUpdateFeeConfigToBuildingRoom",
    method: "post",
    data: data,
  });
}
// /admin/building/room/batchClearFeeConfigToBuildingRoom
// 批量清除房屋收费标准
export function batchClearFeeConfigToBuildingRoom(data) {
  return request({
    url: "/admin/building/room/batchClearFeeConfigToBuildingRoom",
    method: "post",
    data: data,
  });
}
// /admin/building/room/batchUpdateFeeConfigToParking
// 批量更新车位收费标准
export function batchUpdateFeeConfigToParking(data) {
  return request({
    url: "/admin/building/room/batchUpdateFeeConfigToParking",
    method: "post",
    data: data,
  });
}
// /admin/building/room/batchClearFeeConfigToParking
// 批量清除车位收费标准
export function batchClearFeeConfigToParking(data) {
  return request({
    url: "/admin/building/room/batchClearFeeConfigToParking",
    method: "post",
    data: data,
  });
}

// /admin/community/parking/page
// 查询车位列表
export function getParkingSpacePage(query) {
  return request({
    url: "/admin/community/parking/page",
    method: "get",
    params: query,
  });
}
// /admin/community/parking/detail
// 查询车位列表详情
export function getParkingSpaceDetail(id) {
  return request({
    url: `/admin/community/parking/detail/${id}`,
    method: "get",
  });
}
// /admin/community/parking/save
// 保存车位
export function saveParkingSpace(data) {
  return request({
    url: "/admin/community/parking/save",
    method: "post",
    data: data,
  });
}
// /admin/community/parking/update
// 更新车位
export function updateParkingSpace(data) {
  return request({
    url: "/admin/community/parking/update",
    method: "post",
    data: data,
  });
}
// /admin/community/parking/remove
// 删除车位
export function removeParkingSpace(data) {
  return request({
    url: "/admin/community/parking/remove",
    method: "post",
    data: data,
  });
}
// /admin/community/parking/updateBindUnBindMember
// 更新车位绑定住户
export function updateBindUnBindMember(data) {
  return request({
    url: "/admin/community/parking/updateBindUnBindMember",
    method: "post",
    data: data,
  });
}

// /admin/building/room/batchPropertyBill
// 批量生成物业费
export function batchPropertyBill(data) {
  return request({
    url: "/admin/building/room/batchPropertyBill",
    method: "post",
    data: data,
  });
}

// /admin/building/room/batchParkingBill
// 批量生成车位费
export function batchParkingBill(data) {
  return request({
    url: "/admin/building/room/batchParkingBill",
    method: "post",
    data: data,
  });
}

// /admin/property/bill/export
// 导出物业费
export function exportPropertyBill(data) {
  return download("/admin/property/bill/export", data, "物业费.xlsx");
}


